extend ./layout/default

block main-content  
  .panel
    p.queryHeader
      | Scene
      select
        option All
        option Office
        option Hotel
        option Canteen
        option Highway
        option Beach
        option Stadium
        option Rail
      br
      | Month
      select
        option All
        option(value="jan") January
        option(value="feb") February
        option(value="mar") March
        option(value="apr") April
        option(value="may") May
        option(value="june") June
        option(value="july") July
        option(value="aug") August
        option(value="sep") September
        option(value="oct") October
        option(value="nov") November
        option(value="dec") December
      br
      | Frequency
      select
        option All
        option(value="3.5GHz") 3.5GHz
        option(value="millimeter") Millimeter wave
        option(value="highfreq") High frequency
      br
      | Transmitter antenna
      select   
        option All
        option 1
        option 2
        option 3
        option 4
        option 5
        option 6
        option 7
        option 8
      br
      | Receiver antenna
      select   
        option All
        option 1
        option 2
        option 3
        option 4
        option 5
        option 6
        option 7
        option 8
      br
      button#query query
    .list
      each dataset in datasets 
        .cscell.cheatsheet
          a(href="/dataset/#{dataset._id}").title #{dataset.title}
          p.descr #{dataset.description}
  script.
    $('#query').click(function(){
      var selects = $('select')
      var scene = selects[0].value.toLowerCase()
      var month = selects[1].value.toLowerCase()
      var freq = selects[2].value.toLowerCase()
      var sendnum = selects[3].value.toLowerCase()
      var recnum = selects[4].value.toLowerCase()
      console.log(scene, month, freq, sendnum, recnum)
      location.href = `/datasets?scene=${scene}&month=${month}&freq=${freq}&sendnum=${sendnum}&recnum=${recnum}`
    })
